package LuoGu.模拟与高精度.最大乘积;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        BigInteger ans = new BigInteger("1");
        List <Integer> list = new ArrayList<>();
        int index = 0,temp = 2;
        while(index<n){
            list.add(temp);
            index += temp;
            temp++;
        }
        if(index-n==1) {
            list.remove(0);
            list.remove(list.size() - 1);
            list.add(temp);
        }else if(index-n>1){
            list.remove(index-n-2);
        }
        for(int i=0;i<list.size();i++){
            int tempn = list.get(i);
            System.out.print(tempn+" ");
            ans = ans.multiply(new BigInteger(String.valueOf(tempn)));
        }
        System.out.println();
        System.out.print(ans);
    }
}
